import 'package:flutter/material.dart';

class TextDemo extends StatelessWidget {
  const TextDemo({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // return Text(
    //   "wenben" * 20,
    //   maxLines: 2,
    //   overflow: TextOverflow.clip,
    // );

    return Container(
      width: double.infinity,
      color: Colors.green,
      child: Text(
        "文本" * 20,
        maxLines: 1,
        overflow: TextOverflow.ellipsis,
        textDirection: TextDirection.rtl,
        textAlign: TextAlign.center,
        style: TextStyle(color: Colors.white),
      ),
    );
  }
}
